#include <gtest/gtest.h>
#include "Common.h"
#include "KvcBaseDefine.h"
#ifdef USE_DYNAMO
#include "DynamoPublisher.h"
#endif

class KVCachePublisherTest : public ::testing::Test {
protected:
  void SetUp() override {
  }

  void TearDown() override {
  }

};

#ifdef USE_DYNAMO
TEST_F(KVCachePublisherTest, DISABLED_TestNatsClient)
{
    int32_t ret = create_nats_connection();
    assert(ret == KVC_OK);

    StoredBlockData stored_hash_ids[100];
    stored_hash_ids[0].external_hash = 789;
    stored_hash_ids[0].local_hash = 101112;
    stored_hash_ids[1].external_hash = 987;
    stored_hash_ids[1].local_hash = 121110;
    ret = publishStoredEvent(6, 0, stored_hash_ids, 2, true);
    assert(ret == KVC_OK);

    uint64_t removed_hash_ids[100];
    removed_hash_ids[0] = 987;
    removed_hash_ids[1] = 789;
    ret = publishRemovedEvent(7, removed_hash_ids, 2);
    assert(ret == KVC_OK);

    free_nats_connection();
}
#endif

int main(int argc, char** argv) {
    testing::InitGoogleTest(&argc, argv);
    return RUN_ALL_TESTS();
}